#ifndef PLACEMENT_H
#define PLACEMENT_H

#include "cell.h"
#include <QtCore>
#include <QProcess>

class Placement
{
    Cell* cell;
    QPlainTextEdit *debug;
    QStringList nets;

    void pbsPlacement();
    void improveClustersPlacement();
    void testAllPlaces(QList<QList<Transistor*>* > *clusters, QList<QList<Transistor*>* > *curPlacement, int *bestSolution, QList<QList<Transistor*>* > *bestPlacement);
    void setBestPlacement(QList<QList<Transistor*>* > *bestPlacement, QList<QList<Transistor*>* > * curPlacement);
    qreal evaluatePlace(QList<QList<Transistor*>* > *curPlacement);
    int getFirstIndexNetOcurrency(QString curNet, QList<QList<Transistor *> *> *curPlacement);
    int getLastIndexNetOcurrency(QString curNet, QList<QList<Transistor *> *> *curPlacement);
    QList<QList<Transistor*>* >* getClusters();
    boolean hasGap(Transistor* t,  QList<Transistor*> *transistors );

    void taPlacement();
    void dummyPlacement();

    void resetTransistorsRoutePosition();

public:
    Placement();
    void placeTransistors(Cell *cell, int alg, QPlainTextEdit *debug);


};

#endif // POSITIONING_H
